package com.codi.bus.core.service;

import com.codi.bus.core.domain.*;
import com.codi.bus.core.fund.domain.FundPortfolioTransfer;
import com.codi.bus.core.service.model.ApplyModel;
import com.codi.bus.core.service.model.DividendModel;
import com.codi.trade.response.HsTradeApplyQryResponse;
import com.codi.trade.response.HsTradeConfirmQryResponse;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by asus on 2018/4/13.
 */
public interface MessageService {
    void updateFundUserMsg(TradeOrder tradeOrder, OrderFund orderFund, HsTradeConfirmQryResponse tradeRecord) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updateFundFailUserMsg(TradeOrder tradeOrder, OrderFund orderFund, HsTradeConfirmQryResponse tradeRecord) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updatePortfolioFundUserMsg(TradeOrder tradeOrder, PortfolioFundOrder orderFund, List<HsTradeConfirmQryResponse> hsTradeConfirmQryResponseList) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updatePortfolioFundFailUserMsg(TradeOrder tradeOrder, PortfolioFundOrder orderFund, List<HsTradeConfirmQryResponse> hsTradeConfirmQryResponseList) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updatePortfolioTransferUserMsg(FundPortfolioTransfer portfolioTransfer) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updatePortfolioTransferFailUserMsg(FundPortfolioTransfer portfolioTransfer) throws Exception;

    void updateFundFixUserMsg(TradeOrder tradeOrder, OrderFund orderFund, HsTradeApplyQryResponse tradeApplyRecord) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updatefastRedeemUserMsg(BigDecimal shares, String fundName, Long userId, String externalApplyNo, Long profileId) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updatePortfolioUndoUserMsg(Long userId, String portfolioApplyNo, String portfolioCode) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updateUndoUserMsg(Long userId, String applyNo, Long profileId) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void updateDividendUserMsg(DividendModel dividendModel, User user) throws Exception;

    void sendMessageAllUser(String message);

    public int getUserSysMessageCounts(Long userId);

    @Transactional(rollbackFor = Exception.class)
    void updateFixUserMsg(ApplyModel applyModel, User user, List<Lookup> lookups) throws Exception;

    /**
     * 组合调仓发送短信：针对持仓用户发送调仓短信
     */
    void getPortfolioFundMessage();
}
